/*
 * Copyright 2012 Fabian Wenzelmann
 * 
 * This file is part of Recognition-Procedures-for-Boolean-Functions.
 * 
 * Recognition-Procedures-for-Boolean-Functions is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Recognition-Procedures-for-Boolean-Functions is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Recognition-Procedures-for-Boolean-Functions.  If not, see <http://www.gnu.org/licenses/>.
 */

package de.wenzelmf.booleanFunction.parser;

import de.wenzelmf.booleanFunction.booleanExpression.*;

/**
 * An enumeration that contains all available Boolean expression that are binary.
 * 
 * @author Fabian Wenzelmann
 * @version 1.0
 */
public enum BinaryConnectiveType implements Comparable<BinaryConnectiveType>
{
	/**
	 * Conjunction of two expressions.
	 */
	CONJUNCTION
	{
		public BooleanExpression getExpression(BooleanExpression phi, BooleanExpression psi)
		{
			return new Conjunction(phi, psi);
		}
	},
	
	/**
	 * Disjunction of two expressions.
	 */
	DISJUNCTION
	{
		public BooleanExpression getExpression(BooleanExpression phi, BooleanExpression psi)
		{
			return new Disjunction(phi, psi);
		}
	},
	
	/**
	 * Implication of two expressions.
	 */
	IMPLICATION
	{
		public BooleanExpression getExpression(BooleanExpression phi, BooleanExpression psi)
		{
			return new Implication(phi, psi);
		}
	},
	
	/**
	 * If and only if of two expressions.
	 */
	IFF
	{
		public BooleanExpression getExpression(BooleanExpression phi, BooleanExpression psi)
		{
			return new IfAndOnlyIf(phi, psi);
		}
	};
	
	/**
	 * Connects to expressions.
	 * 
	 * @param phi The first expression.
	 * @param psi The second expression.
	 * 
	 * @return The connection of &phi; and &psi;.
	 */
	public abstract BooleanExpression getExpression(BooleanExpression phi, BooleanExpression psi);
	
}
